The basis is that after they process the photo, it automatically gets sent to an API who returns the plate number as a JSON object, then we convert that to standard text using Glide’s API (See first image). The problem I am running into is that I want the numPlateManual in the layout page (See image 2) to auto-populate with the plate number that we pull. I thought converting it to text would make this possible however now it just shows the very first number in the column no matter what. Is it possible to auto-populate the text on the layout page with the result we pull from the image?
I assume you must have a flow somewhere that sets the plate number column to txtPlateNumber. This would allow the number to be manually edited after the API automation.
That doesn’t sound right. On which screen and at what point of the flow are you using the text entry component?
“I assume you must have a flow somewhere that sets the plate number column to txtPlateNumber. This would allow the number to be manually edited after the API automation.”
Yes that would be correct, you click process photo and then the flow initiates that pulls the API value and converts it into text, yes. As you can see in the 1st picture, it is working in the data.
“That doesn’t sound right. On which screen and at what point of the flow are you using the text entry component?”
You can see in the 2nd picture that the text entry component is there, and the 3rd picture shows that it is pulling the data from the txtPlateNumber column. It is empty, until someone processes a photo then it pulls in the data value, but only from the FIRST row. Even though in the data it is updating correctly, in the text entry it is filling it with the first row only no matter what.
So what is the desired behaviour?
The desired behaviour is that it auto-populates in the text field according to the number plate thats being filled in. Eg: in the first picture someone uploaded an image of a car with the license plate number dly870, when they did that instead of the numPlateManual in the 2nd picture writing it in as dly870, it wrote it as 55199. As you can see in the 3rd picture that text entry column is pulling from the txtPlateNumber, the issue is it only pulls from the first row.
It’s easy enough to explain why you’re always getting the first row - that will be because your screen is attached to the first row in the table. If you wanted to get the most recent one added, you could do something like Single Value → Last to fetch that value.
But I can’t help having the feeling that would be taking what is already an overcomplicated process and making it worse.
Can we take a step back and would you mind explaining to me the bigger picture here?
Forget about everything you’ve already done, just describe your desired user experience as if you were starting again from scratch.
I’m reasonably confident that there will be a very simple solution to get what you want, but I just don’t have enough of the bigger picture yet to help you get there.
Good idea, I feel like I am losing myself. Okay imagine a secure complex, and when people buy a house inside of it we get their car/s number plate information. We enter that manually as data in a table labelled tenants. We have a security guard at the gate who, when a car pulls in, takes a picture of the car and clicks process photo. The button sends that image to the plate recognizer API and into a new data table, where we pull the values of the number plate in a JSON object and convert it into normal text(which you helped me do). If the number plate pulled from the API matches any of the number plates in our data table labelled tenants, we want it to auto-populate the text entry field on the screen. If it doesn’t, the security guard will stop them, ask for their purpose of visit, enter the number plate manually, and click the proceed button which will then write any remaining values into the API data table and clear everything for the process to start again.
This is not the use of the app but the best example I could think of.
Simply a screen where the user uploads an image that processes a number plate, if the number plate matches the one in tenant data it auto-populates the text entry field on the screen, if not they can manually enter.
That is incredibly helpful. You should have started with that
Okay, first thing. Based on what I’ve seen so far I am guessing that you are capturing the uploaded image in a form and adding a new row to your Helper table each time. Don’t do that. It’s not necessary and will just make your life more difficult. Your Helper table should only ever contain a single row. No more, no less.
Do it like this:
- Create a User Specific Image column to hold the uploaded image
- Have a button or something to start the process. The action on the button should clear any value in the User Specific column, and expose an image picker for uploading a new photo (Note: this should not be in a Form. Just an image picker on a normal details screen)
- Add your Call API column as you have now, as well as the JSON Query column to retrieve the number from the API response
- Add a relation column that matches the extracted number with the corresponding column in your Tenants table
- Add an if-then-else column:
– If relation is not empty, then license number - That final if-then-else column is what goes into your text input component.
And that should be it.
Is there any way to input it into a text entry field? The idea being it auto-populates a text entry, or else they can enter manually.
Yes, I was wondering about that - but I don’t know what the next step is.
You probably don’t need to auto-populate it at all. Just display it on the screen. If they are submitting a form as the next step, then you can pass it as a value with the form.
So you could still have your text input component, but only expose it if you don’t get a match.
Okay thank you, I also ran into an issue in the text component. As you can see. The image is there, I click process photo and this is the text component set up
And even though it recognizes it in my table (see below) the text component just is not showing up, at all.
hmm, I’m not sure what’s going on there.
try this:
- Add a Lookup column that fetches the plate number from your Tenants table via the relation
- Try using the returned lookup value in your text component instead
oh, and also - make sure your relation is a single relation.
Nope it still is not working, here is more information(and there is no visibility condition for the text component either I did check that just forgot to screenshot it)
Here is the problem
There is nothing in the first row of that table.
As I said earlier…
Get rid of all those extra rows so that you’re always working in a single row.
And if your current setup is adding more rows to that table, you’re doing it wrong.
Okay let me break it down here to make sure I understand, lets say instead of the helper table I have put this in users, as that is also where the image picker is writing data too. My action button in process photo adds a row to the visits table(as I want to keep track of people coming in and out) and takes the values from the user table (so vehicleImage in visits table would be the value of the Image in User table). Then I’d set an action under the “Authorize vehicle” button that clears the values in my users table. That way it clears the relation, image, etc. However the data was still written to my new row in the visits table?
Okay, well that changes things significantly. Certainly not the way I would do it, but lets see if we can work with what you have.
Try this:
I assume that the action on your Process Photo button is the one that adds a row to your Visits table. Add another step to that action after the Add Row: Show Detail Screen → This item.
I believe that should take you to the details screen of the row that’s just been added. I don’t know how reliably that will work, because it’s not something I ever do. But anyway, try it. If that works, then the rest of your process should work from that point forwards as your screen will be attached to the correct row.
So the reason I have it in Users is because the original app(I’m now working on it) has the main screen in Users and there is A LOT already set up on it, like weeks worth, I just need to add the image in and automatic detection for now. As you know the custom screen data source being Users means I can only pull data from Users, the way I’m working around this on the testing app currently is:
So basic breakdown: API Call set up is in Users. The image is writing to users. Process photo takes the image from users(ssAPI img) and puts it into transactions(We’ve been calling it visits), takes the license plate JSON string and puts it into license plates in transactions, etc.
The final button will have an action to clear values from the user table, like the image etc. That way the data stays in transactions, while allowing for the user to start a new one. Does that make sense? Can you think of a simpler way to do it? Am I missing something? It does seem to be working but I am always open to criticisms/recommendations/advice. At the end of the day it’s all about efficiency and using Glide in the best available way.