UiPath Add variable JSON body for HTTP request

Hello Guys,
I am trying to send a slack message with HTTP request and I am using this JSON body
image

I want to add on the body the above variables.

Please help me
Much Appreciated
H.Noka

we have several techniques

  • variable replacement in string
  • JSON API
  • text Template

Can you show me one technique how to do it like the actual body, Im trying so hard!
It would really help me

Sure can you please share the sample JSON aong with all vars for replacement. The No of Vars affects the technique selection. Thanks

“{‘text’: ‘<!here> \n Hello from Gloria \n Revenue is _________ And Daily PPF is __________’}”
On two empty spaces i need to put the revenue variable, which is string and ppf variable which is also string.
Would be great to put also the current date but its nor priority.

THANK YOU Peter

grafik

String.Format("{{'text': '<!here> \n Hello from Gloria \n Revenue is {0} And Daily PPF is {1}'}}","VAL1","VAL2")

1 Like

It works :smiley: You are amazing.
Can you tell me also how to pass Date if possible, current date?

we just add the new place holder {2} withibn the text and provide the value for it
grafik

1 Like

That works, I thank You for that.
But this doesnt work
Now.toShortDateString.ToString("dd.MM.yyyy)
Converting it in european date format

use Now.ToString(“dd.MM.yyyy”)

BLESS YOU!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.