I have a requirement from one of the business process that we are trying to automate.
Where we are getting stuck is to show the records of data.
Submitting the data: We have one form and one gallery. We input the data in the form and then input the data in gallery. The form data is stored in List A with a random number generated. Gallery data is stored in List B with the same random generated number.
Now, we want to view the data. We can successfully view the form data from gallery selected item. But how do we show the List B data as List A and List B are connected through the random generated number so we would want to show the form details and gallery details once the user clicks the arrow button from the browse gallery screen.
I cannot figure out why you are going through such a complicated process to do this. A gallery displays many or all of the records in a list, it can be filtered and sorted on the columns in the list to only show selected records and/or sort them.
A single form is used to submit a new record into that list or modify a record already in the list that is selected in the gallery. The same form can also be used to show all the data in a single record as read-only by setting its display mode.
Once the record is entered or modified, the gallery will automatically show it. From your description, you have duplicated the functions and unnecessarily complicated the process. Since you describe lists, I am assuming you are using SharePoint. If so, SharePoint already assigns an ID to every record in the list that is unique, sequential and not reused. Thus, I don't understand the need for the random numbers.
Please enlighten me if I am wrong about what you are doing here and the relationship between the lists ie. one-to-many or one-to-one? What business process are you trying to duplicate in PowerApps?