Forum Discussion
7 Replies
Sort By
- JohnRogers3Qrew TraineeCreate a table called source. In that table make the records have a numeric value tied to each source. 1 = API 2 = form and 3 = grid. Place the related lookup field inside of your record form where you are wanting to track how these came in. Now when they do the api edit record call add their field ID to the call and the number is value 1 to be sent over. Same with the form. And with grid edit just make an action or automation that basically states if it comes in without a source then write grid edit in source, since you only have 3 options and the other 2 are taken care of.
There is probably a simpler way, but this way would be 100% automated.- JonathanHeuerQrew CadetInteresting, but why would you need a new table? What about a multiple choice field with the three options:
- Grid Edit (this is default value)
- API (set this as part of any API call)
- Form (use a form rule to change to this under appropriate circumstances)
- JohnRogers3Qrew TraineeYou technically wouldn't, I just did that because it is more organized incase future development your source becomes 30 instead of 3. Always build now, that which will work later without having to re-do :D!
- JonathanHeuerQrew CadetGood point John
- TylerParkerQrew Assistant CaptainThanks a lot John, I'll try this
- _anomDiebolt_Qrew EliteYou could do this with a Service Worker but I think there would be more than three cases to decode. Basically the Service Worker would monitor network traffic and if it sees for example an ?a=er it would modify the network request to include an extra field indicating a form was used. Likewise, if ?act=API_* was seen it would modify the network request to include the extra field indicating an API was used. Similar arrangement for Grid Edit.
You would need to cover both GET and POST requests slightly differently and to be comprehensive you might want to record with imports separately.
The main challenge would be to discover and cover all the edge cases. - TylerParkerQrew Assistant CaptainThank you too Dan, would you mind linking me the best sources to find more information on Service Workers and how to get started using them? I've read about capabilities you've mentioned in other posts and I have a programmer that is interested in testing them out in our apps.