Forum Discussion
jfpelletier - Welcome to the Community. To fix your JSON Generator, I believe you simply need to change how you're referencing the value. Try this:
{
"name" : $splitValue,
"customerId" : 771373363,
"templateId" : 8672995468
}
Or you could try using the Mapper snap, which simplifies the construct of these JSON objects since it directly maps the JSON paths in source to target expressions. The same construct as above is done in a Mapper as follows:
I hope this helps!
Hello koryknick,
Thanks a lot for your reply, both options work to give me the correct JSON that I need. 🙂
I prefer the one with the mapper, it seems simpler to me.
The results in the following snap are not good however, I'm getting a 415 error message from the server to which I'm sending this payload.
If I manually enter value for the payload, it works well, the other system returns a 202 (success).
However, if I use the results from the previous snap (the JSON structure that I just generated) as multi-part, I'm getting the 415 error message:
The small characters: Failure: class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap'), Reason: Snap failed unexpectedly and did not provide any reason.
I must be doing something very wrong... Can you see why it's not working?
Thanks!
JF
- SpiroTaleski3 years agoValued Contributor
I guess you should add the absolute path of the directory where the file needs to be created(in the Target path field).
BR,
Spiro TaleskiThank you @Spiro_Taleski. Conceptually, I understand that, however, I am struggling with the syntax. Any insight you can offer on the below?
This works (but only in top level of doc library):
‘Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’This is what I tried for the absolute path to put the file in a subdirectory of the same library.
This does not work.
‘https://mln.sharepoint.com/:f:/r/sites/MxLettersTeamPeerReview/Shared%20Documents/Reports’+'Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’The error I get is:
Either source/target drive (%s) is not found in the tenant
Resolution:
verify if the drive name exists in the tenant.
Reason:
The drive name you have entered might not be available in the tenant.
- SpiroTaleski3 years agoValued Contributor
Did you try to disable the expression button for “Target path”?
If disabled, it should suggest the document library/libraries within the RxLettersTeamPeerReview Site.
Then from there, probably you can see/construct the exact path.
BR,
Spiro Taleski @Spiro_Taleski Thank you. Ironically, I just got help from a co worker who showed me the syntax. Basically, I did not need to put the entire path of the site. The correct syntax ended up being:
“/Reports/”+‘Mx_Manual_Ltrs_’ + Date.now().toLocaleDateTimeString({ timeZone: “EST”, format: “yyyy-MM-dd” }) + ‘.xlsx’
Where “Reports” is the sub dir (under the Doc Library “Documents”) that I put the file.
Thank you again, so much, for being willing to help.
Related Content
- 11 months ago