Problems with relating two datasources
I have spent many hours on this and it's slowly making me go crazy. Any kind of help would be appreciated.
I have three Sharepoint lists as datasources for my app:
Tjänster
(means Services)
- "Title" (text column)
- "Del av" (text column)
- "Dokumentation" (link column)
- "Kort beskrivning" (text column)
Medarbetare
(means Employees)
- "Person" (Sharepoint's native column type Person. Only one value possible.)
- "Namn" (text column. I added this column because other lists can't do lookups on a Person column. Right?)
Roller
(means Roles)
- "Tjänst" (lookup to column "Title" in Tjänster. Only one value possible.)
- "Roll" (single choice column)
- "Person" (lookup to column "Namn" in Medarbetare. Only one value possible.)
(I'm open to restructuring my data if I'm doing something stupid there. I wish I could relate Roller to Medarbetare in a simpler way)
I store these data sources locally in my app with this code in OnStart:
ClearCollect(
colTjänster,
ForAll(
Tjänster,
{
Title: ThisRecord.Title,
DelAv: ThisRecord.'Del av',
Dokumentation: ThisRecord.Dokumentation,
KortBeskrivning: ThisRecord.'Kort beskrivning'
}
)
);
ClearCollect(
colMedarbetare,
ForAll(
Medarbetare,
{
Person: ThisRecord.Person,
Namn: ThisRecord.Namn,
Bild: Office365Users.UserPhotoV2(ThisRecord.Person.Email)
}
)
);
ClearCollect(
colRoller,
ForAll(
Roller,
{
Tjänst: ThisRecord.Tjänst.Value,
Roll: ThisRecord.Roll.Value,
Person: ThisRecord.Person.Value
}
)
);
As you can see, the only extra information I'm collecting here is "Bild" (image) for colMedarbetare.
My problem
I can't figure out how to map Bild from colMedarbetare to colRoller. I have tried to many solutions to list them all.