1

Could someone point me in the right direction please?

I am trying to extract specific text/numbers from a json payload. I can access/isolate the full string of text by using triggerFormDataValue('text').

The text in question may contain 'sendSMS 1122334455 actual message' as its actual value

Is there anyway, in a logic app flow, to break the text into its component parts? (sendsms, 1122334455 and actual message)

n.b. I have already tried interacting with the cognitive analysis app for key word searches but that doesn't return the number, nor the full sting, just the key words.

thanks

tcbwazi
  • 11
  • 3

2 Answers2

0

For more complex logic like the one you have, I would recommend to create an Azure Function. This is a light-weight solution that will offer you the flexibility of a microservice which offers you this possibility.

To extract the numbers, you may use a regular expression.

Edit:

I've found a similar question here on SO, but the conclusion is very similar. I've done some small research now and it seems Microsoft deliberately does't put too much text parsing functionality in Logic Apps in order to avoid them being too complex. You might have a chance if you put them in JSON notation, but I think the better option would be to go to Azure functions, since it provides reuseability as well.

zurebe-pieter
  • 3,246
  • 21
  • 38
  • Thanks! I was hoping to not get further down the rabbit hole really!! out of interest, if I were able to have the actual string use commas as separators (send_sms,number,message) would that make it any easier, do you think? – tcbwazi Apr 23 '18 at 11:57
  • I shall consider this closed. Thank you Pieter. – tcbwazi Apr 23 '18 at 12:26
0

If that's all you need to do, you can use the split() function. Details: String Functions...split

Johns-305
  • 10,908
  • 12
  • 21
  • thanks! that works (when you type in the correct syntax!! ) i was using that yesterday and kept getting it wrong. – tcbwazi Apr 24 '18 at 11:40