Reputation: 21
This is an overview of the data model. I have one table fo Course slots, one Table with Participants and one Table where I book the Participants to a Course slot.
On the canvas app, the user enters to see the list of courses in a gallery, using the course slot table. Clicking the course, takes the user to the selected course. Clicking on this record, he user is taken to a 3rd screen where the related records of Participants are shown. Clicking on this record the user is taken to an edit form to be able to edit the participant record. This step is not working.
I followed this guide (https://www.youtube.com/watch?v=m0WSYJtqMFM) to add a EntryTypeVar on OnStart in the App control. I made that the condition in the form control:
If(
EntryTypeVar = "New",
Defaults('Candidate bookings'),
EntryTypeVar = "Edit",
Gallery1participant.Selected
)
As you can see it's the Look Up table with bookings that I am calling. Choosing the actual Participant table I am wondering if I can do? I only receive errors. For each card I have had to write ThisItem.BookCand.Email. Meaning I first choose the lookup-column and then write the column that is related. This part works. As you can see in the picture it still says "not connected to data". So something about the transfer of data isn't being fetched. And no data shows up when I click.
Here is an image of the the previous screen. The gallery control uses a gallery.selected and each item has a ThisItem.BookCand.Name, also showing the related record.
TLDR: I want to be able to edit a record of an existing item in a table that is a related table. I have tried to use the patch function but not found a solution on how to do that.
Upvotes: 1
Views: 4317
Reputation: 21
So, I figured out a solution.
LookUp(
Candidates,
Name = Gallery1participant.Selected.BookCand.Name
)
I placed this in the Item property on the whole Edit Form. In the Datasource property I wrote Candidates (for the correct dataverse table).
I had to change each card after this change. In each card, in the Default property, a simple ThisItem.ColumnName (instead of the referred table that I had used: ThisItem.ColumnNameOfLookUp.ColumName).
Upvotes: 0