I am building a PowerApp based on an API.
The part where I get items from the API is already working.
What's not working is getting the app to send back updates to the API.
I have a screen that contains a gallery showing short summaries of each item, with a ">" button to go to a details screen that shows one item in full, with 2 of the item properties shown as editable: a textinput box and a checkbox are used.
The details screen contains a single-row gallery that contains the two controls mentioned, as well as various labels showing item properties that should not be updated.
I want the update of the checkbox to trigger an action that sends back the changed item to the API.
The API has various functions of which 2 are relevant here:
a - Leveringen(key1, key2) => collection of items as shown in the galleries
b - LeveringenUpdate(key1,key2,key3,jsonobject)
(a) is the function that delivers the items as I see them.
So the "ThisItem" that I see in the details screen comes from function (a).
function (b) expects 3 primitive values as well as 1 record / item, sent as json to the API by the connector, and this item is of the exact same type that function (a) delivers.
The question is: how to initiate the update action using function (b)?
I tried the following but up to now it did not work:
In the "OnCheck" property of the checkbox I typed this formula:
...APIName.LeveringenUpdate("2017-07-03";ProduktenVandaagList1.Selected.ProduktID;ThisItem.LeverID;ThisItem)
So there is 3 primitive key-values, and then there is "ThisItem" for the whole item that needs to be sent as json.
It gives me this error message (translated into english): "The function does not have an optional parameter called 'Datum'".
I recognise the word "Datum": it is one of the fields that are expected as part of "ThisItem".
What could be the problem?
After all the item represented by ThisItem came from the API so it should still have the proper composition, or is this a wrong assumption? If wrong: what can I do to repair the problem?
If I click in the formula and put the cursor in the "ThisItem" part, I see the current definition of "ThisItem" appear. It shows all the expected field names except "Datum" which seems to be renamed as "Datum_1".
Why did this happen and could this be the cause of the problem?
With best regards,
Wolter Kaper