title: update observable object from array in observable object
body: <p>I have documents id in the Information I am getting from service. I need documents Info to be attached to this parent information and return parent. Not able to return observables in loop.</p>
  <p>The second switch map is working fine. The first is not executing if I return tInfo from map, it gives following error below.</p>
  <blockquote>
  <p>Argument of type '(tInfo: {        documents;        documentsInfo:
  any[];    }) =&gt; void' is not assignable to parameter of type '(value:
  { documents: any; documentsInfo: any[]; }, index: number) =&gt;
  ObservableInput'.   Type 'void' is not assignable to type
  'ObservableInput'</p>
  </blockquote>
  <pre><code>public transform(tId: any,name: string, args?: any): Observable&lt;string&gt; {
    return this.sService.getTaxById(tId).pipe(
      // tslint:disable-next-line: deprecation
      switchMap((tInfo:{ documents ; documentsInfo: any [] }) =&gt; {
        if (tInfo.documents) {
          tInfo..documents.forEach(doc =&gt; {
            return this.sService
              .getFiles(doc.docId).pipe(
                map((filesInfo: { FileName: ''; downloadUrl: '' }) =&gt; {
                          const fileObjnew =
                            {
                              docName: filesInfo.FileName,
                              downloadUrl: filesInfo.downloadUrl,
                            }
                            tInfo.documentsInfo.push(fileObjnew);
                        })
              );
          });
         return of(taxInfo);
        }
      }),
      // tslint:disable-next-line: deprecation
      switchMap((Info: { cc: '' ; authority: '' ; cName: ''}) =&gt; {
        if (Info.authority) {
          const cc = taxInfo.cc;
          return this.sService.getOrgs(cc).pipe(
            map((orgsData: any) =&gt; {
              console.log(&quot;Data============&gt;&quot;, orgsData);
              (orgsData || []).forEach(tax =&gt; {
                if (orgsData.aid === tax.id) {
                  Info.cName = tax.parentName;
                }
              });
              return Info;
            })
          );
        }
      }),
      map((Info) =&gt; {
        if (name === 'subsTemplate') {
          return this.subsTemplate(Info);
        }
      })
    );
  }
  </code></pre>