// Fetch the 'Environment ID' of current environment
// Store the in the 'varCurrentEnvironmentID' variable
Set(
varCurrentAppUri,
First('Canvas Apps').AppOpenUri //Canvas Apps table
);
Set(
varCurrentEnvironmentID,
Right(
Match(
varCurrentAppUri,
"/e/.*(?=/a)"
).FullMatch,
36
)
);
// Use PowerAppsforMakers.GetEnvironments() and fetch all the environments under the tenant
// Store Environments in to 'collAllEnvironments' collection
ClearCollect(
collAllEnvironments,
AddColumns(
Sort(
PowerAppsforMakers.GetEnvironments().value, //the connector
DataSourceInfo.DisplayName
),
DisplayName,
properties.linkedEnvironmentMetadata.friendlyName,
Url,
properties.linkedEnvironmentMetadata.instanceUrl
)
);
// Filter 'collAllEnvironments' with 'varCurrentEnvironmentID' and fetch the current environment's URL
Set(
varCurrentEnvironmentURL,
First(
Filter(
collAllEnvironments,
varCurrentEnvironmentID in id
)
).Url
);
SubmitForm(Form1);
Set(varInvoice, Form1.LastSubmit);
Set(
varInvoiceUrl,
Concatenate(
varCurrentEnvironmentURL,
"/main.aspx?pagetype=entityrecord",
"&etn=cr597_invoices", //the table logic name
"&id=", varInvoice.Invoices //GUID
)
);
Patch(
Invoices, // The table
varInvoice,
{ myurl: varInvoiceUrl } //myurl is the column store the url
);
Notify("Link written to column myurl", NotificationType.Success);
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2