从响应中提取json对象

当您向自定义提交处理程序提交Headless自适应表单时,可以提取提交处理程序返回的数据,并将其显示在您的react应用程序中。 以下代码片段显示

// associate event handler for the onSubmitSuccess event
<AdaptiveForm mappings={extendMappings} onSubmitSuccess={onSuccess} formJson={selectedForm}/>
// extract the json returned by the custom submit service
const onSuccess=(action) =>{
        let body = action.payload?.body;
        let FirstName = JSON.parse(body.metadata.json).firstName;
        setThankYouMessage(FirstName+" your request has been received");

      }
recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69