An option in your import mapping is to find the object by Key. Go to the top of your import mapping, open the object and set the options with suit your purpose:
Hi Suat, could you please mark my answer as the correct one so everyone knows your (initial) problem is solved.
For your second issue you would have to use the return list of objects which is returned by the call. Add the attribute URL to the entity and in an iterator/loop, set this attribute with ‘https://www.tenderned.nl/tenderned-tap/aankondigingen/’ + $ObjectName/PublicatieId’ as value. Then commit the list of objects.
There are several approaches you could take.
The quickest, laziest, and dirtiest way is to retrieve and delete all previous entries before you make your call to the REST service. This may not be ideal if you associate the results to any other entities as those associations will be lost.
Another approach is retrieve and check you have data before making the call. If you have data and you are sure it won’t change, you may be able to just return what you have retrieved instead of calling the REST service.
If you can give us more details on the service you are calling, we may be able to suggest a better way.
I'm still new to Mendix and I’m learning and working on the Mendix Free Cloud, and I really appreciate that you are helping me out. It is perhaps indeed best if I give you a detailed background and I will try to keep it as brief as possible.
I have created a rest call (get) which is invoked with a button through a microflow (screenshot of microflow included below).
The rest call retrieves a dataset that is a collection of published tenders in the last 24 hours for the time being, but this period will change to the last 120 hours once I get a working proof-of-concept.
The problem is that the users will retrieve the latest published dataset by starting the rest call microflow, because the data might have changed, or another user might have taken over.
The published tenders that are retrieved via the rest call are saved by an import mapping in an entity with four attributes; PublicatieId with type Integer which is an unique id-number for each tender, AanbestedingNaam with type String which is a description of the tender, AanbestedendeDienstNaam with type String which is the name of the party that issued the tender, and the fourth attribute is Europees with type Boolean which says whether the tender is a European tender or not (there is a legal difference between those two and an Euopean tender needs to be handled in a specific protocol).
A data grid presents the entity named ‘Tenders’ where these tenders are stored, to the user in my app in order for them to decide whether a tender is interesting enough to explore further or not. Each tender will be weighed in this way, and the interesting tenders that will be qualified to be explored further, will be copied or cloned (I’m not sure how to this part yet) to another entity that is named ‘Bids’.
The qualification is dependent on the tenders so deleting the tenders and replacing them with new tenders is probably not the way to go, since the weighing whether to be qualified or not will also be lost with that.
I have two problems I would like to solve;
Hi Sjors, wow that did the trick!
Thank you for your help, I really appreciate it.
I did have one more question though:
One of the attributes I retreive via the restCall is ‘PublicationId’ and I need to use the value of this attribute to construct a URL that I would like to save in the same entity ‘Tenders’ in a new attribute called ‘TenderLink’.
The URL should be like this (of course [PublicatieId] should be swapped with the actual value of ‘PublicatieId’)
I don't really know how to do this though; do you perhaps have an idea how I could solve this problem?