使用 Power Automate 获取 Power App TextInput 字段中的数据时出现问题

问题描述 投票:0回答:1

我已经制作了一个电源自动化流程,以在 Power App 中从 google 工作表中获取特定行。 在应用程序中,当我输入主键值并按搜索按钮时,文本输入字段应该显示来自谷歌工作表的数据。为此,我为搜索按钮编写了代码。我已附上以下代码:

` // 触发流程并存储响应 放( 回复, DM_Sheet_Search.Run(TextInput1.Text) //DM_Sheet_Search 为流程名称 );

// Debugging: Display the entire response using JSON
Notify("Response received: " & JSON(response, JSONFormat.Compact), NotificationType.Information);

// Check if response contains expected fields and update text input fields
If(
!IsError(response),
// Assuming response is an object with fields
If(
    !IsBlank(response.review),
    UpdateContext({ textInput1_1Value: response.review })
);
If(
    !IsBlank(response.msshrutireview),
    UpdateContext({ textInput1_2Value: response.msshrutireview})
);
If(
    !IsBlank(response.mrgirishreview),
    UpdateContext({ textInput1_3Value: response.mrgirishreview})  //a,b,c are the column names of the google sheet
)
);

// Ensure text input fields are updated with variable values
TextInput1_1.Text = textInput1_1Value;
TextInput1_2.Text = textInput1_2Value;
TextInput1_3.Text = textInput1_3Value;`

正在获取数据,但未显示在相应的文本输入字段中。[PowerApp 和自动化流程的屏幕截图](https://i.sstatic.net/fMNkuw6t.jpg)

尝试使用 Automate Flow 在 Power App 上的文本输入字段上获取和显示数据。 我希望文本输入字段能够显示从谷歌表格中获取的数据,以便我可以更新/删除数据字段。

power-automate powerapps powerapps-canvas powerapps-formula
1个回答
0
投票

要解决 Power Automate 流中的 PowerApp TextInput 字段中不显示数据的问题,请按照以下步骤操作:

确保 Power Automate 流程正确解析 JSON 响应。使用“响应”操作将数据传回 PowerApps,并验证流程是否返回正确的字段。 在 PowerApps 中,检查响应字段是否正确映射到您的 TextInput 字段。您可以通过使用 Notify 函数检查流的输出来对此进行调试。 在确认响应有效后,直接将响应值分配给 TextInput 字段,从而简化 PowerApps 中的验证逻辑。 这应该确保正确获取和显示数据。

© www.soinside.com 2019 - 2024. All rights reserved.