
Announcements
Hi,
I have encountered some issues regarding building an apps in power apps.
1) In my screen there are a form viewer and editable excel-like gallery. On my App screen, here is my code
OnStart:
ClearCollect(MyCollection, { Item: 1, Description: "", 'Supplier Item No (SIN)': "", UoM: "", 'Day QTY':"", Currency: "", 'Total QTY': "", 'Unit Price (USD)': "", 'Discount Rate (If Any)' : 0, Total: 0}
);
ClearCollect(colSubTotal, {Items:1,TotaL:0});
Set(resetComboBox, false);
Set(resetComboBox, true);
Set(resetAll, false);
Set(resetAll, true);
However, all the items inserted in the gallery does not store in the collection.
2) There is a label text of Grand Total. When I add item, the label function normally but whenever I delete an item, the grand total return 0. Since in Total text I put the calculation code, so I create a new collection name (colSubTotal) to store only the Value of total for each item. Below is the code for delete button: However as I said on 1) MyCollection does not store anything so it cannot patch anything.
Remove(MyCollection, ThisItem);
Clear(colSubTotal);
ForAll(MyCollection, Collect(colSubTotal, {TotaL: Total}));
UpdateContext({GrandTotal:Sum(colSubTotal, TotaL)});
3) How to store form viewer and the editable excel-like gallery in one sharepoint? Since my collection does not store anything, hence I cannot continue store data into my sharepoint. Plus, the form viewer does not recognized the item either I used the column name or field name.
4) I wanted to send email based on selected email in combo box. In my combo box I connect with an excel file that has 2 columns (Name and Email). I display both on the combo box. When I try to run the apps, and choose only one email, I got error prompt "Error when trying to retrieve data from from the network: Expression "Email eq null" is not supported. Below is the code that I used: When I insert ThisItem.Item i got red underline as it does not recognized it.
Launch("mailto:" & cbEmail_1.Selected.Email &
"?subject=Approval for MSRF Form" &
"&body=" &
Concat(
Filter(Gallery4_11.AllItems,IsEdited),
Concatenate("Item:",ThisItem.Item, "Description:",Description, "Supplier Item No (SIN):",'Supplier Item No (SIN)',
"UoM:",UoM, "Day QTY:", 'Day QTY', "Currency:", Currency, "Unit Price (USD):", 'Unit Price (USD)',
"Discount Rate (If Any):", 'Discount Rate (If Any)', "Total QTY:", 'Total QTY', "Total:", TotaL, Char(100)
))
)
Hope anyone can help me with my problems. Appreciate it and thank you.
Update:
I have solved problem no 4). Below is the updated code that solved my problem:
// Extract the email address from the selected item
Set(
extractedEmail,
Mid(
cbEmail_1.Selected.Email,
Find("<", cbEmail_1.Selected.Email) + 1,
Find(">", cbEmail_1.Selected.Email) - Find("<", cbEmail_1.Selected.Email) - 1
)
);
// Send the email using the extracted email address
Office365Outlook.SendEmailV2(
extractedEmail,
"Approval for MSRF Form",
"Please find the attached MSRF form below."
)