Flow Builder Logic トレイルヘッド


+ [Build Flows with Flow Builder> Flow Builder Logic> Define Multiple Paths in a Flow](https://qiita.com/Keiji_otsubo/items/a72cfebab7fbc1ca45c2)

# Run a Flow Within a Flow

ここから再開するんだけど、うまくいくかな？　探しても以前のプレイグランドが見つからない。

+ とりあえず、何もせずに検証ボタンをクリックしてみる。

:::note alert
We can’t find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API Name.
:::

う~ん、とりあえずは今回作るサブフローしか見てないかも...

以下を設定しただけでは、うまく保存できてないかもしれない。

+ Create a text variable:
  + API Name: ProductKW
  + Available for input: checked

:::note alert
We can’t find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API Name.
:::

とりあえず、次のレコード取得要素を追加して保存してみた。


:::note
We can’t find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API Name.
:::

変わりませんね。有効化しているかを見ているかもしれません。
しまった、プレイグランドを間違ってました....

:::note alert
We can’t find the Add Generator Product to Named Opps flow. Make sure you complete the Prework before attempting this challenge.
:::

ほとんど、設定していないけどこのサブフローはチェックしてない感じですね。

Add Generator Product to Named Opps flowはどんなフローかな？

https://www.youtube.com/watch?v=-s0k41yQ5Qs


これですかね？
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/581d49be-8218-b81f-c65d-718b23db6988.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/b2340e79-48c1-3fbe-e162-7ee60a435c62.png)


https://www.youtube.com/watch?v=PjONbUJFbGk

その前にエラーがある。

:::note alert
Create_Opp_Product (Create Records) - Because the object field has the value "null", you also need to set the following fields: sObjectInputReference.
:::

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/03b9ef54-e993-3aed-8f24-00023628ce4c.png)

作り直したら、エラーは消えたな。

とりあえず、作ってみようか？

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/d16ba72f-57a1-ea52-3aff-85d125ececac.png)

:::note alert
This variable is available only in the latest version of the referenced flow.

To test this flow, run it in debug mode and select the option to run the latest version of each referenced flow. To avoid runtime errors when you activate this flow, also activate the latest version of the referenced flow.
:::


:::note alert
In the Subflow-Create Generator Opp Product flow, we can't find the latest version activated.
:::

何故か最新が有効になってなかったみたい。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/36a76f11-4820-2c7e-ff5a-c5a3352f7fa6.png)

::::note alert
We can’t find a Subflow element named 'Create 2000 Opp Product'. Make sure the API Name is 'Create_2000_Opp_Product'.
:::

まだ2000は作ってないので、当然のエラーだな。しかし、だんだん形になってきたかも。このフローをチェックしている感じですね。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/ed2daab5-bbb0-82a6-7f41-f9e9b151d7b0.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/d292b70b-7bf6-66d7-1379-aee31ee0689c.png)


:::note alert
In the Check Opp Name element, we can’t find an outcome named '1000kW'. Make sure its API Name is 'X1000kW'.
:::


有効化しないとダメみたいですね。

:::note alert
In the Add Generator Product to Named Opps flow, we can't find the latest version activated.
:::

有効化したら合格です。

# Route and Reorder Flow Elements

クイズ？

# We can’t find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API Name.


+ [【未解決】We can’t find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API Name.](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007X7pMYSAZ)
+ [【未解決】Subflow-Create Generator Opp Product](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX000000nX1x)

+ [I'm checking the challenge in Run a Flow Within a Flow unit, but I'm getting this error: "We can't find an Autolaunched flow named 'Subflow-Create Generator Opp Product'. Make sure you saved the flow with 'Subflow_Create_Generator_Opp_Product' as the API](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000KBULz)

:::note
My issue got resolved. 

I gave an incorrect name to the Decision box. After correcting it in the latest version, the challenge got completed.

私の問題は解決しました。 

決定ボックスに間違った名前を付けました。最新バージョンで修正したら、チャレンジが完了しました。
:::

# Because the object field has the value "null", you also need to set the following fields: sObjectInputReference

+ [【未解決】Work with Salesforce Records in Flows](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007cmFsbSAE)
+ [【未解決】What is "null" in this context, and why does it cause this error?](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000MXzIk)