'set value in dictionary for key' block does nothing...why?

I am trying to update the key value in a dictionary.

And then update the corresponding dictionary element in a global array - but ignore this bit.

I can’t even get the individual dictionary key value to update!

’set value for key' => key: nRanking to nRanking

This block apparently does nothing!

The nRanking relates to the order that these businesses appear in the list.

And, as a test, I am simply reversing the ranking order.

The DoDsiplayMessage just calls notifier message box

This is the output…
So the new nRanking value for ‘Food Bank’ is 4 and yet the nRanking value in dictSponsor is still 1.
’Set value for key in dictionary to ‘ block has done nothing!
WHY? How do you get the dictionary blocks to change a key value?

Or is it that the ‘select list item at index’ block is not returning a dictionary?

If not then what is it returning?

In PHP on my website I have constructed an array of dictionaries or associative arrays.
Then I json_encode this array and send it to my app.
Then in my app I json_decode it back into an array of dictionaries.

It seems a list, you can check it with “is a list?” or “is a dictionary?” block

Please show the content of the list global g_arraySponsorRankings

I believe what you will need to do is reorder this list based upon your preferences.

Can’t because it is generated dynamically from a json array sent from my web page.
And I figured it out anyway. I used the ‘json decode text’ block when I should have been using this one

image

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