In a project I’m working on ppl enter the mailing address and can then tick a box if their current residential address is the same as their mailing address.
In the json file that i receive this box translates to a value which will be either true or false, depending on whether they ticked that box or not.
Now I need to use that in an If Condition.
I wrote it like this: currentResidentialAddress.Item(“sameAsMailingAddress”)=true
where currentResidentialAddress is a JObject
and sameAsMailingAddress is the value in the json file.
But now I’m getting an error saying I can’t use operator = for Jtoken or Boolean…
@JCH
Assuming that currentResidentialAddress is a JToken that has been properly set, you should do currentResidentialAddress.Item("sameAsMailingAddress").Value(of Boolean) as your condition, the =true part is unnecessary.
Additionally it looks like there is a typo in the json pictured, it looks like “Mailing” is spelled as “Maling” so be careful with that.
thanks @HareeshMR and sorry for the partial information
I’m a total newby, but if I’m understanding what you are saying, I already deserialized the json which is why I was able to use currentResidentialAddress.Item(“sameAsMailingAddress”) successfully. I think…
Hi @DanielMitchell, I have a follow up question on this project.
I have to enter the details from the json file into a website. I have to provide 5 years of residential history.
Every time I have a new address, I need to click NEW. That will then open up a new list of fields to fill in. I would then populate the address details from data in the next object. Hopefully I got the terminology right there…
So my steps would be:
For each address in previousResidentialAddress, click new.
Type street
Type city
etc, etc
click save
How should I put that in the for each activity? street would be the item right, so I can’t do for each item. Not sure how to get started on that…
^ You said it yourself. Use a For Each with the collection being your group of previous addresses. Then each loop item is a complete address and you can enter its info. If you want to share your complete json I could mock something up real quick to simulate the logic.
Thanks @DanielMitchell. here is the json. STA_JSON_SAMPLE.json (2.6 KB)
I realize I need to do a for each activity, but just not sure what the ForEach field should have. Would it still be item?