My JSON skills aren’t the greatest. Looking for some help.
I am trying to go through each phone number that appears on this account, check if “unsubscribedModes: [SMS]” is present for a corresponding phone number. If so, then skip this transaction.
My issue is - I can’t get each individual phone number to show up in my “write line” activity. I can’t do “currentitem(“phoneNumber”).tostring” for some reason. I can only get my “write line” to return each individual object.
How can I make this so I can pull out whatever piece of info I need? ie. The phone number and if SMS is unsubbed.
Hi @supermanPunch - Thank you, that worked! I would have never figured this out… I have older projects that let me simply put in (“item1”)(“item2”). No clue what “DirectCast” is, but thank you!!
Do you know of a cleaner way to get “SMS” to show up from the array in the output panel? There may be times when other strings are in that array along with “SMS”.
we hope that it is ensured that the for each typeargument was set to JObject
Can check and tell us the result? If so the direct cast should be obsolete
Similar, if a Deserialize JSON Activity is involved, check also always the configured TypeArgument
Ok we do know that there are some debatable directions along with bugs / added / removed functionalities. However we can check on which the for each typeargument is interpreted
And force control e.g. by using the Value / Values / Cast method
myJObject is a JObject
resulting to:
the selected method / setting is to derive from the JSON Structure
Would you also happen to know how to get the array items out of “unsubscribedModes”? I can’t seem to get only the string(s) contained within the array.
Hi @ppr - I really appreciate the help, and I will check out that link for the JSON knowledge. As far as this goes, due to the project urgency, I might just have to go with an “if” statement if the JSON contains “unsubscribedModes” and if that contains the string “[ “SMS” ]”. Not ideal, but I can’t get this to work perfectly.