Use search module result to fetch data from RPC

Hi everyone, I have a search module which searches for an audience member based on their email. The search module itself is working great and I am able to use the returned data in other actions.

But a use case I have is that once the search module runs and I get back the data, I need to use the hash returned in the data in another action where I need to run a RPC which will take that hash and return me the data for that particular hash. But this doesnt seem to work. For some reason the RPC is not getting that hash value in {{parameters.hash}}.

Here’s a video to better understand the issue

Also this is how my RPC and mappable parameters look like for the second action
RPC:

{
	"url": "/audience/{{parameters.hash}}/achievements",
	"method": "GET",
	"qs": {
		"limit": 10000
	},
	"response": {
		"iterate": "{{body.data}}",
		"output": {
			"label": "{{item.title}}",
			"value": "{{item.id}}"
		}
	}
}

Mappable parameters:

[
	{
		"name": "hash",        // Makes value accesible via "{{parameters.id}}".
		"type": "text",  // Set the type to unsigned integer.
		"label": "Audience Hash",  // Sets the uuser friendly label visible in the module.
		"required": true,     // Sets the parameter as mandatory.
		"rpc":{
			"label": "Search",
			"url": "rpc://getAudience",
			"parameters": [
				{
					"name": "email",
					"type": "text",
					"label": "Audience Email",
					"required": true
				}
			]
		},
		"nested": [
				{
					"name": "achievements",
					"type": "select",
					"required": true,
					"label": "Achievements",
					"help": "Select the achievements you want to delete",
					"multiple": true,
					"options": "rpc://getAudienceAchievements"
				}
			]
	}
]

Hey @developer - it looks like you’re pretty comfortable with Make App development. Kudos!

From your description, I think you need to store the value of the hash parameter before the nesting of the Achievements parameter.

The nested statement just affects the visual representation in the UI - it doesn’t do anything with the data. The store statement saves the data you need in the nested parameter.

You can read more on this in the App Builder help here.

5 Likes