# getting-started

Bobby Hargett

10/03/2023, 3:05 PM
I have Flow1 returns data that Flow2 needs, if Flow1 fails then I want Flow2 to basically rewrap that error and emit it. If Flow1 is successful I want Flow2 to return a room DB Flow. flow1.combine(flow2), but obviously there is no way to pass the value from flow1 to flow2 I tried{x flow2Fun(x) } where flow2Fun returns a Flow<A>, but the map gives a result of Flow<Flow<A>>. What is the best way to do this, since flow1 can change during life of app

Felipe Ferraz

10/03/2023, 3:11 PM
I suggest to use
Copy code
flow1.transform { result1 ->
you can either use emitAll to re-emit all results from flow2 or do a conditional emit based on flow1 and flow2 result